package com.uetoken.cn.network;

import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.uetoken.cn.common.Api;
import com.uetoken.cn.common.Constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 谢杨
 * @time 2018/8/13 10:41
 * @class 描述:参数工具类
 */
public class Params {
    /**
     * 请求示例
     */
    public static void requestExample() {
        // TODO: 2018/8/3 第一步将需要的参数组成一个mao集合
        Map<String, String> map = new HashMap<>();
        map.put("mobile", "15107605016");
        // TODO: 2018/8/1 第二步将需要的参数和公共参数组成一个新的map集合
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        // TODO: 2018/8/1 第三步通过请求方式和新的集合获取签名参数
        String signature = HttpParamsSignature.getSignatureParams("GET", newMap);
        // TODO: 2018/8/1 第四步将获得的签名参数一起放入newMap中
        newMap.put("Signature", signature);
        // TODO: 2018/8/1 第五步开始请求网络
    }

    /**
     * @return 获取配置文件参数
     */
    public static Map<String, String> getConfigPamars() {
        String updateTime = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_OTHER_INFO).getString(Constant.SP_CONFIG_UPDATE_TIME, "");
        Map<String, String> map = new HashMap<>();
        map.put("Updatetime", updateTime);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param phone 手机号
     * @return 获取短信参数
     */
    public static Map<String, String> getSmsParams(String phone) {
        boolean loginStatus = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getBoolean(Constant.SP_WHETHER_LOGIN, false);
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        if (loginStatus) {
            map.put("Nodeid", nodeid);
        } else {
            map.put("Nodeid", "0");
        }
        map.put("Mobileno", phone);
        map.put("Typeid", "9");
        map.put("Content", "");
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param mobileno  (string): 手机号码 ,
     * @param pwd       (string): 登录密码 ,
     * @param smscode   (string): 短信验证码 ,
     * @param pnodecode (string, optional): 推荐人账号/手机/邮箱,可为空 ,
     * @param opentype  (integer, optional): 绑定的第三方账号类型：1-QQ、2-微信、3-微博、4-Pcn、5-优谷 ,
     * @param openid    (string, optional): 第三方账号
     * @return 用户注册地址
     */
    public static Map<String, String> getRegisterParams(String mobileno, String pwd, String smscode, String pnodecode, String opentype, String openid) {
        Map<String, String> map = new HashMap<>();
        map.put("mobileno", mobileno);
        map.put("smscode", smscode);
        map.put("pwd", pwd);
        map.put("pnodecode", pnodecode);
        map.put("opentype", opentype);
        map.put("openid", openid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param nodecode  账户
     * @param pwd       密码
     * @param logintype (integer, optional): 第三方账号登录类型：0=UE,1-QQ、2-微信、3-微博、4-Pcn、5-优谷
     * @return 用户登录参数
     */
    public static Map<String, String> getLoginParams(String nodecode, String pwd, String logintype) {
        Map<String, String> map = new HashMap<>();
        map.put("nodecode", nodecode);
        map.put("pwd", pwd);
        map.put("logintype", logintype);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取用户基本信息参数
     */
    public static Map<String, String> getUserBaseInfoParams() {
        String nodeCode = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_CODE, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodecode", nodeCode);
        map.put("purseid", "0");
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取绑定优谷信息Url
     */
    public static Map<String, String> getBindYGInfoPrepareParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param nodeCode 优谷的账号/手机/邮箱
     * @param pwd      优谷的支付密码(BASE64加密)
     * @return 绑定优谷账号前的准备参数
     */
    public static Map<String, String> getBindYGAccountPrepareParams(String nodeCode, String pwd) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("nodecode", nodeCode);
        map.put("pwd", pwd);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param account 优谷账号
     * @param pwd     优谷密码
     * @return 绑定优谷账号参数
     */
    public static Map<String, String> getBindYGAccountParams(String account, String pwd) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("nodecode", account);
        map.put("pwd", pwd);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param longitude 经度
     * @param latitude  纬度
     * @return 用户签到参数
     */
    public static Map<String, String> getUserSignParams(String longitude, String latitude) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("longitude", longitude);
        map.put("latitude", latitude);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 钱包列表参数
     */
    public static Map<String, String> getPurseListParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param purseid 子钱包id
     * @param days    天数
     * @param reason  原因
     * @return 钱包历史详情与统计参数
     */
    public static Map<String, String> getPurseListHistoryParams(String purseid, String days, String reason, int historyType) {
        Map<String, String> map = new HashMap<>();
        if (historyType == Constant.MIAN_PURSE_HIS) {
            map.put("purseid", purseid);
            map.put("reason", reason);
        } else if (historyType == Constant.CHILD_PURSE_HIS) {
            map.put("purseid", purseid);
            map.put("reason", reason);
//            map.put("subpurseid", purseid);
        } else if (historyType == Constant.STOCK_OUT_HIS) {
            map.put("purseid", purseid);
        } else {
            map.put("purseid", purseid);
            map.put("reason", reason);
        }
        map.put("days", days);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param nodeid    (integer, optional): 用户标识 ,
     * @param pageindex (integer, optional): 当前页码数 ,
     * @param pagecount (integer, optional): 页大小
     * @return 钱包历史详情与统计参数
     */
    public static Map<String, String> getChargeCNVListHistoryParams(String nodeid, String pageindex, String pagecount) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("pageindex", pageindex);
        map.put("pagecount", pagecount);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 支付准备参数
     */
    public static Map<String, String> getPayPrepareParams(Map prePareMaps) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        for (Object prePareMap : prePareMaps.entrySet()) {
            map.put(((Map.Entry) prePareMap).getKey() + "", ((Map.Entry) prePareMap).getValue() + "");
            LogUtils.e(((Map.Entry) prePareMap).getKey() + "", ((Map.Entry) prePareMap).getValue() + "");
        }
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param optype      操作类型.1-其它应用唤醒UE，2-扫一扫二维码，3-其它应用扫一扫UE二维码
     * @param paytype     支付类型
     * @param paypwd      支付密码,base64编码
     * @param payMaps     服务器返回的json参数集合
     * @param fingerprint 是否是指纹支付 1=是 ,
     * @return 支付参数
     */
    public static Map<String, String> getPayParams(String optype, String paytype, String paypwd, String fingerprint, Map payMaps) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("paytype", paytype);
        map.put("optype", optype);
        map.put("paypwd", paypwd);
        map.put("fingerprint", fingerprint);
        for (Object payMap : payMaps.entrySet()) {
            map.put(((Map.Entry) payMap).getKey() + "", ((Map.Entry) payMap).getValue() + "");
        }
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param type    输入的用户类型1.姓名, 2.手机号码, 3.邮箱, 4.头像的url 5.支付密码 6.登录密码 7=最高免密支付金额
     * @param info    输入修改的信息 ,
     * @param smscode 短信验证码
     * @return 获取修改用户常规信息的Url
     */
    public static Map<String, String> getModifyUserInfoParams(String type, String info, String smscode) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("type", type);
        map.put("info", info);
        map.put("smscode", smscode);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取me模块点击item后跳转到webview，url所需要的拼接参数
     */
    public static Map<String, String> getMeItemStitchingParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("GET", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param frompurseid 当前转出方钱包ID/子钱包ID(由接口ListSubPurse获得)
     * @param tonodecode  转入方用户账号/手机/邮箱,或者子账号
     * @param amount      金额，最多2位小数,APP前端限制为正整数
     * @param paypwd      BASE64加密的支付密码
     * @return 钱包历史详情与统计参数
     */
    public static Map<String, String> getPurseTransferParams(String frompurseid, String tonodecode,
                                                             String amount, String paypwd, int pursetypeid, String rate) {
        Map<String, String> map = new HashMap<>();
//        if (transferType == Constant.TRANSFER_OBJECTS_TO_MAIN_PURSE) {
//            map.put("tonodecode", tonodecode);
//        } else if (transferType == Constant.TRANSFER_OBJECTS_TO_SUB_PURSE) {
//            map.put("topurseid", tonodecode);
//        }
        map.put("frompurseid", frompurseid);
//        map.put("typeid", typeid);
        map.put("tonodecode", tonodecode);
        map.put("amount", amount);
        map.put("paypwd", paypwd);
        map.put("rate", rate);
        map.put("pursetypeid", pursetypeid + "");
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param nodecode 账号/手机/邮箱
     * @param purseid  钱包id,0为特殊值
     * @return 获取用户信息（点击校验账号）
     */
    public static Map<String, String> getUserInfoParams(String nodecode, String purseid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodecode", nodecode);
        map.put("purseid", purseid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param purseid 钱包id,0为特殊值
     * @return 获取用户信息（点击校验账号）
     */
    public static Map<String, String> getSubPursesParams(String purseid) {

        Map<String, String> map = new HashMap<>();
        map.put("purseid", purseid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param purseid  出货的钱包的ID
     * @param tonodeid 被出货人的用户ID
     * @param amount   数量,前台控制为正整数
     * @param pwd      BASE64加密的支付密码
     * @return 钱包历史详情与统计参数
     */
    public static Map<String, String> getStockoutParams(String purseid, String tonodeid, String amount,
                                                        String pwd) {
        Map<String, String> map = new HashMap<>();
        map.put("purseid", purseid);
        map.put("tonodeid", tonodeid);
        map.put("amount", amount);
        map.put("pwd", pwd);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param purseid  出货的钱包的ID
     * @param tonodeid 被出货人的用户ID
     * @param amount   数量,前台控制为正整数
     * @param pwd      BASE64加密的支付密码
     * @return 钱包历史详情与统计参数
     */
    public static Map<String, String> getStockoutHisParams(String purseid, String tonodeid, String amount,
                                                           String pwd) {
        Map<String, String> map = new HashMap<>();
        map.put("purseid", purseid);
        map.put("tonodeid", tonodeid);
        map.put("amount", amount);
        map.put("pwd", pwd);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param purseid   主钱包ID
     * @param pusername 子钱包的名字
     * @return 钱包创建子钱包参数
     */
    public static Map<String, String> getCreateSubPurseParams(String purseid, String pusername) {
        Map<String, String> map = new HashMap<>();
        map.put("purseid", purseid);
        map.put("pusername", pusername);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param content 通过base64加密的文件/图片文件
     * @param typeid  类型
     * @return 上传文件参数
     */
    public static Map<String, String> getUploadFileUrlParams(String content, String typeid) {
        Map<String, String> map = new HashMap<>();
        map.put("content", content);
        map.put("typeid", typeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param oldmobileno 旧手机号
     * @param newmobileno 新手机号
     * @param oldsmscode  旧手机号验证码
     * @param newsmscode  新手机号验证码
     * @return 修改用户手机号参数
     */
    public static Map<String, String> getModifyUserPhoneParams(String oldmobileno, String newmobileno, String oldsmscode, String newsmscode) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("oldmobileno", oldmobileno);
        map.put("newmobileno", newmobileno);
        map.put("oldsmscode", oldsmscode);
        map.put("newsmscode", newsmscode);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param mobileno 手机号
     * @param smscode  验证码
     * @param pwd      密码
     * @return 忘记密码参数
     */
    public static Map<String, String> getForgetPwdParams(String mobileno, String smscode, String pwd) {
        Map<String, String> map = new HashMap<>();
        map.put("mobileno", mobileno);
        map.put("smscode", smscode);
        map.put("pwd", pwd);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取收货地址的参数
     */
    public static Map<String, String> getAddressUrlParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取省市区列表参数
     */
    public static Map<String, String> getAreaParams() {
        Map<String, String> map = new HashMap<>();
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取我页面的基本信息的参数
     */
    public static Map<String, String> getMyParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取绑定银行卡列表的参数
     */
    public static Map<String, String> getBindBankParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param bankaccoutid
     * @return 获取删除银行卡的参数
     */
    public static Map<String, String> getDeleteBankParams(String bankaccoutid) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("bankaccoutid", bankaccoutid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取银行卡信息的参数
     */
    public static Map<String, String> getBanksInfoParams() {
        Map<String, String> map = new HashMap<>();
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param accountname 银行卡持有人的姓名
     * @param account     银行卡号
     * @param bankinfoid  银行的ID
     * @param bankcity    银行开户所在的城市
     * @param branchbank  支行信息
     * @param mobileno    手机号码
     * @return 用户新增银行卡的参数
     */
    public static Map<String, String> getUserCreateBankCardParams(String accountname, String account, String bankinfoid, String bankcity, String branchbank, String mobileno) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("accountname", accountname);
        map.put("account", account);
        map.put("bankinfoid", bankinfoid);
        map.put("bankcity", bankcity);
        map.put("branchbank", branchbank);
        map.put("mobileno", mobileno);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param title   标题
     * @param message 内容
     * @param image   图片Url
     * @return 提交意见反馈的参数
     */
    public static Map<String, String> getCreateFeedBackParams(String title, String message, String image) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("title", title);
        map.put("message", message);
        map.put("image", image);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取意见反馈列表的参数
     */
    public static Map<String, String> getFeedBackListParams() {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param typeid 类型 0=全部 1=系统
     * @return 获取用户站内信的Url
     */
    public static Map<String, String> getMainsParams(String typeid) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("typeid", typeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param hisids 用户站内信的主键组合，-1为特殊值表示全部未读，多个用逗号隔开，例如1,3,4
     * @param status 站内信状态：1.已读 -1.删除
     * @return 修改站内信状态为已读取状态
     */
    public static Map<String, String> getEditMainStatusParams(String hisids, String status) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("hisids", hisids);
        map.put("status", status);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param consigneeid 对应收货地址的主键值
     * @return 删除收货地址
     */
    public static Map<String, String> getDeleteShippingAddressParams(String consigneeid) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("consigneeid", consigneeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param regionid      传入用户选的区
     * @param address       用户输入的详细地址
     * @param consigneename 输入的收货人
     * @param mobile        输入收货人的电话号码
     * @param consigneeid   新增时为0,修改时为对应收货地址的主键值
     * @param postcode      邮政编码
     * @param isdefault     是否设置未默认地址 0=不设置 1=设置
     * @return 创建或者设置默认地址
     */
    public static Map<String, String> getCreateOrSettingDefaultAddressParams(String regionid, String address, String consigneename, String mobile,
                                                                             String consigneeid, String postcode, String isdefault) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("regionid", regionid);
        map.put("address", address);
        map.put("consigneename", consigneename);
        map.put("mobile", mobile);
        map.put("consigneeid", consigneeid);
        map.put("postcode", postcode);
        map.put("isdefault", isdefault);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * //@param nodecode 账号/手机/邮箱
     *
     * @param purseid purseid (integer, optional): 钱包ID ,
     * @return 获取钱包金额
     */
    public static Map<String, String> getPurseParams(String purseid) {

        Map<String, String> map = new HashMap<>();
        map.put("purseid", purseid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @return 获取进货模块点击后跳转到webview，url所需要的拼接参数
     */
    public static Map<String, String> getStockParams(String infoid) {
        String nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("infoid", infoid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("GET", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 查询用户所有第三方账号绑定状态
     *
     * @param nodeid 用户的ID
     */
    public static Map<String, String> getQueryBindThirdpartyParams(String nodeid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 绑定第三方账号接口
     *
     * @param nodeid   用户的ID ,
     * @param opentype 绑定的第三方账号类型：1-QQ、2-微信、3-微博、4-Pcn、5-优谷 ,
     * @param openid   第三方的账号,Opentype=4/5时，openid=nodecode
     */
    public static Map<String, String> getBindThirdpartyParams(String nodeid, String opentype, String openid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("opentype", opentype);
        map.put("openid", openid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 解绑第三方账号接口
     *
     * @param nodeid   (integer, optional): 用户的ID ,
     * @param opentype (integer, optional): 绑定的第三方账号类型：1-QQ、2-微信、3-微博、4-Pcn、5-优谷 ,
     */
    public static Map<String, String> getBindThirdpartyParams(String nodeid, String opentype) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("opentype", opentype);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 开通指纹支付
     *
     * @param nodeid (integer, optional): 用户的ID ,
     * @param paypwd (integer, optional): BASE64加密的支付密码 ,
     * @param typeid (integer): 免密类型 1=指纹支付 2=... ,
     */
    public static Map<String, String> getOpenFingerprintPaymentParams(String nodeid, String paypwd, String typeid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("paypwd", paypwd);
        map.put("typeid", typeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 关闭指纹支付
     *
     * @param nodeid (integer, optional): 用户的ID ,
     * @param typeid (integer, optional): 免密类型 1=指纹支付 2=... ,
     */
    public static Map<String, String> getCloseFingerprintPaymentParams(String nodeid, String typeid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("typeid", typeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 充值CNV
     * nodeid (integer): 用户ID ,
     * paytype (integer): 支付类型 = ['0'],
     * amount (number, optional): 充值金额 ,
     */
    public static Map<String, String> getChargeCNVParams(String nodeid, int paytype, String amount) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("paytype", String.valueOf(paytype));
        map.put("amount", amount);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 区块链
     * 获取钱包列表
     * nodeid (integer): 用户ID ,
     */
    public static Map<String, String> getTransPursesParams(String nodeid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 区块链
     * 根据钱包获取钱包地址
     * nodeid (integer): 用户ID ,
     * purseconfigid (integer): 钱包类型 ,
     */
    public static Map<String, String> getPurseAddressByPurseParams(String nodeid, String purseconfigid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("purseconfigid", purseconfigid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 区块链
     * 获取提现信息
     * nodeid (integer): 用户ID ,
     * purseconfigid (integer): 钱包类型 ,
     */
    public static Map<String, String> getWithdrawalInfoParams(String nodeid, String purseconfigid) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("purseconfigid", purseconfigid);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * 区块链
     * 提币
     * POST /api/Blockchain/CashWithdrawal
     * nodeid (integer): 用户ID ,
     * purseconfigid (integer): 钱包配置id ,
     * amount (number): 提币数量 ,
     * orderid (string): 订单号 ,
     * purseaddress (string, optional): 提币地址 ,
     */
    public static Map<String, String> getCashWithdrawalParams(String nodeid, String purseconfigid, String amount, String orderid, String purseaddress, String memo) {
        Map<String, String> map = new HashMap<>();
        map.put("nodeid", nodeid);
        map.put("purseconfigid", purseconfigid);
        map.put("amount", amount);
        map.put("orderid", orderid);
        map.put("purseaddress", purseaddress);
        map.put("memo", memo);

        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param id 钱包id,0为特殊值
     * @return 获取用户信息（点击校验账号）
     */
    public static Map<String, String> getExchangeRateByPurseParams(String id) {
        Map<String, String> map = new HashMap<>();
        map.put("purseconfigid", id);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }

    /**
     * @param id 钱包id,0为特殊值
     * @return 获取用户信息（点击校验账号）
     */
    public static Map<String, String> getMinTransferNumParams(String id) {
        Map<String, String> map = new HashMap<>();
        map.put("purseconfigid", id);
        Map<String, String> newMap = HttpParamsSignature.getParamsMap(map);
        String signature = HttpParamsSignature.getSignatureParams("POST", newMap);
        newMap.put("Signature", signature);
        return newMap;
    }
}
